package com.woniuxy.educationplatform.service.impl;

import com.woniuxy.educationplatform.bean.TransportBean;
import com.woniuxy.educationplatform.mapper.TransportMapper;
import com.woniuxy.educationplatform.service.ITransportService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
@Transactional(readOnly = true)
@Service
public class TransportServiceImpl implements ITransportService {
    @Resource
    private TransportMapper transportMapper;
    @Override
    public TransportBean findById(Long id) {
        return transportMapper.findById(id);
    }

    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public void add(TransportBean transportBean) {
        transportMapper.add(transportBean);
    }
}
